class code3 {
    //判定是否互为字符重排
    public boolean CheckPermutation(String s1, String s2) {
        if(s1.length()!=s2.length()) {
            return false;
        }
        int[] hash = new int[26];
        for(int i=0;i<s1.length();i++) {
            hash[s1.charAt(i)-'a']++;
        }
        for(int i=0;i<s1.length();i++) {
            hash[s2.charAt(i)-'a']--;
            if(hash[s2.charAt(i)-'a']<0) {
                return false;
            }
        }
        return true;
    }
}